home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
SYS
/
s
/
AutoSave.wrx
< prev
next >
Wrap
Text File
|
1996-09-26
|
1KB
|
68 lines
/*
* Autosave Script for WRITE
*
* Checks the environment variable "WRITE.Autosave" and takes its value
* in minutes between two saves. If the variable could not be found, it
* pops up a requester and asks for the autosave interval.
*
* Just run it {@ASYNC} from a write window.
*
* written 1994 by Lars Hanke, MGR-Asgard
*
*/
IF ~show('P',"WRITE") then
do
say "This script is for the WRITE editor. Please start it first."
exit 10
end
ADDRESS 'WRITE'
OPTIONS RESULTS
'VERSIONCHECK 3848 "AutoSave.wrx"'
IF RC~=0 THEN DO
exit 10
END
'GetVar (_CurrentID)'
ID = RESULT
'LockWindow' ID
IF Open(File,"ENV:WRITE.Autosave") THEN
do
SAVEDELAY = ReadLn(File);
call Close(File);
end
else do
'GetNumber (Minutes of Autosave delay) 5 {@TOMOUSE}'
'GetVar (_RN)'
SAVEDELAY = RESULT
if SAVEDELAY <= 0 then SAVEDELAY = 5
end
'LockWindow 0'
AUTOSAVE = SAVEDELAY * 60
do forever
ADDRESS 'COMMAND'
"WAIT" AUTOSAVE
ADDRESS 'WRITE'
'LockWindow' ID
'GetVar (_CurrentID)'
IF RESULT ~= ID THEN
do
'LockWindow 0'
exit 0
end
'GetVar (_Changed)'
IF RESULT ~= 0 then 'Save _FileName'
'LockWindow 0'
end